home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
- Declare Function FindWindow Lib "user" (ByVal lpClassName As Any, ByVal lpCaption As String) As Integer
- Declare Function ShowWindow Lib "User" (ByVal Handle As Integer, ByVal Cmd As Integer) As Integer
- Declare Function SetWFocus Lib "User" Alias "setfocus" (ByVal Handle As Integer) As Integer
- Const Hourglass% = 11
- Const Arrow% = 0
- Global MainForm As form
-
- Sub AddNewItem (ctrl As Control, sItem As String, lItemIndex As Long)
- ctrl.AddItem sItem
- ctrl.ItemData(ctrl.NewIndex) = lItemIndex
-
- End Sub
-
- Sub ArrowCursor ()
- Screen.ActiveForm.MousePointer = Arrow
- End Sub
-
- Sub CenterFromScreen (i As form)
- i.Top = Screen.Height / 2 - ((i.Height / 2))
- i.Left = Screen.Width / 2 - ((i.Width / 2))
- End Sub
-
- Sub CenterIt (oldform As form, newform As form)
- newform.Top = (oldform.Top + (oldform.Height / 2)) - ((newform.Height / 2))
- newform.Left = (oldform.Left + (oldform.Width / 2)) - ((newform.Width / 2))
- End Sub
-
- Function CheckCmdLine (sStr As String) As Integer
- Dim sCmd$
-
- sCmd = Command$
- If InStr(1, sCmd, sStr, 1) Then
- CheckCmdLine = True
- Else
- CheckCmdLine = False
- End If
-
- End Function
-
- Function Encrypt (ByVal oldstring As String) As String
- Dim i, j, length As Integer
- Dim NewString, cChar As String
-
- NewString = ""
- oldstring = UCase(oldstring)
- length = Len(oldstring)
- For i = 1 To length
- j = Asc(Mid$(oldstring, i, 1))
- If j > 64 And j < 91 Then
- If j < 78 Then
- j = j + 13
- ElseIf j > 77 Then
- j = j - 13
- End If
- End If
- cChar = Chr$(j)
- NewString = NewString & cChar
- Next
-
- Encrypt = NewString
- End Function
-
- Sub fillfullscreen (i As form)
- i.Top = 0
- i.Left = 0
- i.Height = Screen.Height
- i.Width = Screen.Width
- End Sub
-
- Sub FindProgram (sName As String)
- Dim x%, Handle%
-
- If app.PrevInstance Then
- Handle = FindWindow(0&, sName)
- x = ShowWindow(Handle, 1)
- x = SetWFocus(Handle)
- End
- End If
-
- End Sub
-
- Sub HourglassCursor ()
- Screen.ActiveForm.MousePointer = Hourglass
- End Sub
-
- Sub ModalForm (frmNew As form)
- Load frmNew
- CenterFromScreen frmNew
- frmNew.Show 1
- DoEvents
- End Sub
-
- Sub ModelessForm (frmNew As form)
- Load frmNew
- CenterFromScreen frmNew
- frmNew.Show 0
- End Sub
-
- Sub SelectText (source As Control)
- source.SelStart = 0
- source.SelLength = Len(source.Text)
- End Sub
-
- Function ShowYesNo (nVal As Integer) As String
- If nVal = 1 Then
- ShowYesNo = "Yes"
- Else
- ShowYesNo = "No"
- End If
- End Function
-
-